package com.whxyxj.text3;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
    private String[] mTitles = new String[]{"气动卧姿控制模式", "气动预防压舱模式", "床单自动整理模式", "便盘模式","肢体空气波模式","躯体气波模式","电动模式"};

    public MyFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 1) {
            return new Fragment_qdy();
        } else if (position == 2) {
            return new Fragment_czz();
        }
        else if (position == 3) {
            return new Fragment_bp();
        }
        else if (position == 4) {
            return new Fragment_ztk();
        }
        else if (position == 5) {
            return new Fragment_qtk();
        }
        else if (position == 6) {
            return new Fragment_dd();
        }
        return new Fragment_qdw();
    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    //用来设置tab的标题
    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
}
